package cn.domob.android.ads;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import java.util.HashMap;

public class j
{
  public static B a;
  private static J b = new J(j.class.getSimpleName());
  private static j c;
  private static String k = null;
  private static String l = null;
  private static String m = null;
  private String d = "http://r.domob.cn/a/";
  private String e = null;
  private String f = null;
  private boolean g = false;
  private long h;
  private int i;
  private String j = null;

  public static j a()
  {
    monitorenter;
    try
    {
      if (c == null)
        c = new j();
      j localj = c;
      return localj;
    }
    finally
    {
      monitorexit;
    }
  }

  protected String a(Context paramContext)
  {
    if (this.e == null);
    try
    {
      PackageManager localPackageManager = paramContext.getPackageManager();
      ApplicationInfo localApplicationInfo;
      if (localPackageManager != null)
      {
        localApplicationInfo = localPackageManager.getApplicationInfo(paramContext.getPackageName(), 128);
        if (localApplicationInfo != null)
        {
          Bundle localBundle = localApplicationInfo.metaData;
          if (localBundle == null);
        }
      }
      try
      {
        String str = localApplicationInfo.metaData.getString("DOMOB_PID");
        if ((this.e == null) && (str != null))
        {
          this.e = str;
          b(this.e);
        }
        return this.e;
      }
      catch (Exception localException2)
      {
        Log.e("DomobSDK", "DOMOB_PID is missed in AndroidManifest.xml!");
        return null;
      }
    }
    catch (Exception localException1)
    {
      Log.e("DomobSDK", "Failed to get applicationInfo.");
      b.a(localException1);
    }
    return null;
  }

  protected void a(String paramString)
  {
    if (paramString == null)
      return;
    b.b("Set AD server url:" + paramString);
    this.d = paramString;
  }

  // ERROR //
  protected void a(String paramString1, String paramString2)
  {
    // Byte code:
    //   0: aload_1
    //   1: putstatic 42	cn/domob/android/ads/j:k	Ljava/lang/String;
    //   4: aload_2
    //   5: putstatic 44	cn/domob/android/ads/j:l	Ljava/lang/String;
    //   8: ldc 130
    //   10: putstatic 46	cn/domob/android/ads/j:m	Ljava/lang/String;
    //   13: new 132	org/json/JSONObject
    //   16: dup
    //   17: aload_2
    //   18: invokespecial 133	org/json/JSONObject:<init>	(Ljava/lang/String;)V
    //   21: astore_3
    //   22: aload_3
    //   23: invokevirtual 137	org/json/JSONObject:keys	()Ljava/util/Iterator;
    //   26: astore 5
    //   28: aload 5
    //   30: invokeinterface 143 1 0
    //   35: ifeq +62 -> 97
    //   38: aload 5
    //   40: invokeinterface 147 1 0
    //   45: invokevirtual 148	java/lang/Object:toString	()Ljava/lang/String;
    //   48: astore 6
    //   50: aload_3
    //   51: aload 6
    //   53: ldc 130
    //   55: invokevirtual 152	org/json/JSONObject:optString	(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //   58: astore 7
    //   60: aload 6
    //   62: invokestatic 156	java/lang/Class:forName	(Ljava/lang/String;)Ljava/lang/Class;
    //   65: pop
    //   66: getstatic 40	cn/domob/android/ads/j:b	Lcn/domob/android/ads/J;
    //   69: new 114	java/lang/StringBuilder
    //   72: dup
    //   73: invokespecial 115	java/lang/StringBuilder:<init>	()V
    //   76: ldc 158
    //   78: invokevirtual 121	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   81: aload 6
    //   83: invokevirtual 121	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   86: invokevirtual 124	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   89: invokevirtual 125	cn/domob/android/ads/J:b	(Ljava/lang/String;)V
    //   92: aload 7
    //   94: putstatic 46	cn/domob/android/ads/j:m	Ljava/lang/String;
    //   97: return
    //   98: astore 4
    //   100: getstatic 40	cn/domob/android/ads/j:b	Lcn/domob/android/ads/J;
    //   103: ldc 160
    //   105: invokevirtual 162	cn/domob/android/ads/J:e	(Ljava/lang/String;)V
    //   108: return
    //   109: astore 8
    //   111: goto -83 -> 28
    //
    // Exception table:
    //   from	to	target	type
    //   13	28	98	org/json/JSONException
    //   28	60	98	org/json/JSONException
    //   60	97	98	org/json/JSONException
    //   60	97	109	java/lang/Exception
  }

  protected void a(boolean paramBoolean, long paramLong, int paramInt)
  {
    this.g = paramBoolean;
    this.h = paramLong;
    this.i = paramInt;
  }

  protected String b()
  {
    return this.d;
  }

  protected String b(Context paramContext)
  {
    if (this.f == null)
      this.f = new d(paramContext, "domob_config").a("cookie_id", null);
    return this.f;
  }

  protected void b(String paramString)
  {
    if ((paramString == null) || ((paramString != null) && (paramString.length() == 0)))
    {
      Log.e("DomobSDK", "Incorrect Domob publisher ID.");
      return;
    }
    Log.i("DomobSDK", "Current publisherID is " + paramString);
    this.e = paramString;
  }

  protected long c()
  {
    return this.h + 1000 * this.i;
  }

  protected void c(String paramString)
  {
    this.f = paramString;
  }

  protected boolean c(Context paramContext)
  {
    if (this.g)
      if (System.currentTimeMillis() >= this.h + 1000 * this.i);
    for (int i1 = 1; ; i1 = 0)
      while (true)
      {
        if ((i1 == 0) && (this.g))
        {
          this.g = false;
          this.h = 0L;
          this.i = 0;
          HashMap localHashMap = new HashMap();
          localHashMap.put("timestamp", Long.valueOf(0L));
          localHashMap.put("disable", Boolean.valueOf(false));
          localHashMap.put("time", Integer.valueOf(0));
          new d(paramContext, "domob_config").a(localHashMap);
        }
        return i1;
        i1 = 0;
      }
  }

  protected String d()
  {
    return this.j;
  }

  protected void d(String paramString)
  {
    this.j = paramString;
  }

  protected boolean e()
  {
    return (k != null) && (l != null);
  }

  protected boolean e(String paramString)
  {
    if (k != null)
      try
      {
        if (Integer.parseInt(paramString) <= Integer.parseInt(k))
          return false;
        b.b("get origin detection config update");
        return true;
      }
      catch (Exception localException)
      {
      }
    return false;
  }

  protected String f()
  {
    return m;
  }

  protected String g()
  {
    return k;
  }
}

/* Location:           C:\Users\god\Desktop\liunianjishiben_V1.1_mumayi_3745b_dex2jar.jar
 * Qualified Name:     cn.domob.android.ads.j
 * JD-Core Version:    0.5.4
 */